package com.diandian.backend.client.param;

import com.diandian.base.boot.starter.exception.DefaultException;
import com.diandian.backend.client.dto.ClientPermissionUpdateByIdParamDTO;
import java.io.Serializable;

public class ClientPermissionUpdateByIdParam implements Serializable {

	private Long id;
	private String permissionGroup;
	private String permissionKey;
	private String permissionName;
	private String remark;

	public void check(){
		if(this.id == null){
			throw new DefaultException("id不能为空");
		}
		if(this.permissionGroup == null || "".equals(this.permissionGroup)){
			throw new DefaultException("权限分组为空");
		}
		if(this.permissionKey == null || "".equals(this.permissionKey)){
			throw new DefaultException("权限标识为空");
		}
	}

	public ClientPermissionUpdateByIdParamDTO toDTO(){
		ClientPermissionUpdateByIdParamDTO dto = new ClientPermissionUpdateByIdParamDTO();
		dto.setId(this.id);
		dto.setPermissionGroup(this.permissionGroup);
		dto.setPermissionKey(this.permissionKey);
		dto.setPermissionName(this.permissionName);
		dto.setRemark(this.remark);
		return dto;
	}

	public Long getId() {
		return id;
	}
	public Long setId(Long id) {
		return this.id = id;
	}
	public String getPermissionGroup() {
		return permissionGroup;
	}
	public String setPermissionGroup(String permissionGroup) {
		return this.permissionGroup = permissionGroup;
	}
	public String getPermissionKey() {
		return permissionKey;
	}
	public String setPermissionKey(String permissionKey) {
		return this.permissionKey = permissionKey;
	}
	public String getPermissionName() {
		return permissionName;
	}
	public String setPermissionName(String permissionName) {
		return this.permissionName = permissionName;
	}
	public String getRemark() {
		return remark;
	}
	public String setRemark(String remark) {
		return this.remark = remark;
	}
}
